package com.example.elmspringboot.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.elmspringboot.domain.Address;
import com.example.elmspringboot.mapper.AddressMapper;
import com.example.elmspringboot.mapper.AdminMapper;
import com.example.elmspringboot.service.AddressService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AddressServiceImpl extends ServiceImpl<AddressMapper, Address> implements AddressService {
    @Resource
    private AddressMapper addressMapper;
    @Override
    public List<Address> getAddressByUserId(Integer id) {
        LambdaQueryWrapper<Address> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(true,Address::getUserId,id);
        return  addressMapper.selectList(wrapper);
    }
}
